// pages/result/result.js
const app = getApp()
Page({

    /**
     * 页面的初始数据
     */
    data: {
        statusBarHeight: app.globalData.statusBarHeight,

        num: 10,
        distance: 0, // 箭头位置
        color: '', // 得分颜色
        list: [
            {
                title: '平时您是否有皮肤"发痒"或"疼痛"的感觉',
                opyions: ['极严重','严重','轻微','无']
            },
            {
                title: '平时您是否有一下症状',
                opyions: ['感冒','流鼻涕','其他','无']
            },
            {
                title: '平时您是否有一下症状66',
                opyions: ['感冒66','流鼻涕','其他','无']
            }
        ],
    },
    // 再次测试
    toevaluation() {
        wx.redirectTo({
          url: '/pages/evaluation/evaluation',
        })
    },
    // 在线复诊
    
    tofollowup() {
        wx.redirectTo({
            url: '/pages/followup/followup',
        })
    },
    before() {
        wx.navigateBack({
            delta: 1
        })
    },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        var that = this
        const query = wx.createSelectorQuery()
        query.select('.schedule').boundingClientRect((result) => {
            var rulewidth = result.width*0.325,resultw = result.width,color=['',''],bag=''
            if (that.data.num <= 5) {
                rulewidth = (rulewidth/5)*that.data.num
                color[0] = '#1fc482'
                color[1] = '#1fc482'
                bag = '#1fc48233'
            } else if(that.data.num <= 9) {
                rulewidth = (rulewidth/3)*(that.data.num-6)+rulewidth*1+resultw*0.0125
                color[0] = '#ffb300'
                color[1] = '#ffb300'
                bag = '#ffb3002e'
            } else if(that.data.num <= 30) {
                rulewidth = (rulewidth/20)*(that.data.num-10)+rulewidth*2+resultw*0.0125*2
                color[0] = '#e75760'
                color[1] = '#e75760'
                bag = '#e7576030'
            }
            that.setData({
                distance: rulewidth,
                bag: bag,
                color: color
            })
        }).exec()
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {

    }
})